package StudyCode.summary.mycollection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class PopTheLastElementOffTheArray {
	public static void main(String[] argv) {
		String[] array = new String[]{"1", "abc", "level", null,
				"www.tah1986.com", "asdf 123"};
		System.out.println(java.util.Arrays.toString(popFromArray(array)));
	}

	public static String[] popFromArray(String[] array) {
		String[] ans = null;
		if (0 == array.length) {
			ans = new String[0];
		} else {
			ans = new String[array.length - 1];
			System.arraycopy(array, 0, ans, 0, array.length - 1);
		}
		return ans;
	}
}
